
package date;

import java.util.Calendar;
import java.util.Date;

/**
 * 給一個 long 的數值, 並把它 parse 成日期<br>
 * <br>
 * Copyright: Copyright (c) 2001-2007<br>
 * Company: 一零四資訊科技股份有限公司
 * 
 * @author Eric.Kao(eric.kao@104.com.tw)
 * @version 1.0
 */
public class FectchDate
{
	public FectchDate()
	{
		Date date = new Date();

		long time = date.getTime();

		Calendar calendar = Calendar.getInstance();

		calendar.setTimeInMillis( time );

		System.out.println( "year:" + calendar.get( Calendar.YEAR ) );
		System.out.println( "month:" + ( calendar.get( Calendar.MONTH ) + 1 ) );
		System.out.println( "day:" + calendar.get( Calendar.DAY_OF_MONTH ) );
	}

	public static void main( String[] args )
	{
		new FectchDate();
	}
}
